<?php

//基础控制器
namespace app\common\controller;
use think\Controller;
use app\common\model\Artcate;

class Base extends Controller
{
    protected function _initialize()
    {
        $cat=new Artcate;
        $catList=$cat->where('status',1)->order('sort')->select();
        if(count($catList)>0)
            $this->assign('catList',$catList);

    }
    protected function isLogin()
    {
        if(!session('?user_id'))
            $this->error('请先登录！','user/login');
    }

}